package cn.xshi.bpm.service.impl;

import cn.xshi.bpm.service.LcGroupService;
import cn.xshi.common.base.BaseService;
import cn.xshi.bpm.dao.LcGroupDao;
import cn.xshi.bpm.model.LcGroup;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
 * @Desc 产品组
 * @Author 邓纯杰
 * @CreateTime 2012-12-12 12:12:12
 */
@Service
public class LcGroupServiceImpl extends BaseService implements LcGroupService {

    @Resource
    private LcGroupDao lcGroupDao;

    /**
     *
     * @param condition
     * @return
     */
    public List<LcGroup> getLcGroupList(Map<String,Object> condition){
        return lcGroupDao.getLcGroupList(condition);
    }

    /**
     *
     * @return
     */
    public LcGroup getLcGroupById(String id){
        return lcGroupDao.getLcGroupById(id);
    }

    /**
     * 添加
     * @param lcGroup
     * @return
     */
    public int addLcGroup(LcGroup lcGroup){
        lcGroup.setCreateTime(getDate());
        lcGroup.setCreateId(getCurrentAccountId());
        lcGroup.setId(toUUID());
        return lcGroupDao.addLcGroup(lcGroup);
    }

    /**
     * 修改
     * @param lcGroup
     * @return
     */
    public int updateLcGroup(LcGroup lcGroup){
        lcGroup.setUpdateId(getCurrentAccountId());
        lcGroup.setUpdateTime(getDate());
        return lcGroupDao.updateLcGroup(lcGroup);
    }

    /**
     * 删除
     * @param condition
     * @return
     */
    public int delLcGroup(Map<String, Object> condition){
        return lcGroupDao.delLcGroup(condition);
    }
}
